package org.fatmansoft.teach.models;

import lombok.*;

import javax.persistence.*;
import java.io.File;
import java.util.List;
import java.util.Set;


@Entity
@Data
@EqualsAndHashCode(exclude = {"students","course"})
@Table(	name = "home_work",
        uniqueConstraints = {
        })
public class HomeWork {

    @Id
    private Integer homeWorkId;

    private String homeWorkName;

    private String homeWorkTime;

    private boolean selected;

    @ManyToOne
    private Course course;

    @ManyToMany(mappedBy = "homeWorks", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @ToString.Exclude
    private Set<Student> students;

    @ManyToOne
    private Teacher teacher;


}
